<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <?php include VIEWPATH . 'head.php'; ?>
    </head>
    <body>
        <div id="head">
            <div id="headinner">
                <div id="logo">
                    <a href="/" class="ajax"><img src="<?= $config['res_url'] ?>/images/logo.png" alt="" /></a>
                </div>
                <div id="nav">
                    <ul class="ajax">
                        <li><a href="/" title="首页">首页</a></li>
                        <li id="myfamily">
                            <a href="/family/">我的家庭<?php if ($familybill['bills'] > 0) { ?><i><?= $familybill['bills'] ?></i><?php } ?></a>
                            <ul>
                                <?php if ($user['family_id']) { ?>
                                    <li class="down"><a href="/family/">管理家庭</a></li>
                                    <?php foreach ($familybill['bill_list'] as $k => $v) { ?>
                                        <li><a href="/bill/index/?user_id=<?= $v['id'] ?>"><?= $v['nickname'] ?></a><?php if ($v['bills']) { ?><i><?= $v['bills'] ?></i><?php } ?></li>
                                    <?php } ?>
                                <?php } else { ?>
                                    <li class="down"><a href="/family/">未加入家庭</a></li>     
                                <?php } ?>
                            </ul>
                        </li>
                        <li><a href="/category/" title="类别">类别</a></li>
                        <li><a href="/account/" title="账户">账户</a></li>
                        <li><a href="/note/" title="私信">私信</a></li>
                        <li><a href="/statics/" title="统计查询">统计查询</a></li>
                        <li><a href="javascript:;" title="工具">工具</a>
                            <ul style="width:100px;">
                                <li><a href="/task/" title="定时记账">定时记账</a></li>
                                <li><a href="/bbs/index/3/" title="意见反馈">意见反馈</a></li>
                            </ul>
                        </li>
                        <!--                        <li><a href="javascript:;" title="未上线" style="color:#B7C1C1">好友</a></li>-->
                        </li>
                    </ul>
                </div>
                <div id="status">
                    <?php if (check_login()) { ?>
                        你好!<?= $user['nickname'] ?> <a href="/user/profile/" class="ajax">设置</a> <a href="/user/logout/">退出</a>
                    <?php } else { ?>
                        游客,您好!     
                        <a href="/user/login/">登录</a>
                        <a href="/user/register/">注册</a>
                        <a href="/user/findpwd/">忘记密码</a>
                    <?php } ?>
                </div>
            </div>
        </div>
        <div id="loading"><b></b><em>加载中...</em></div>
        <div id="main" class="clear">
            <div id="sidebar">
                <div class="sidebox">
                    <div class="boxcontent clear">
                        <ul class="sidemenu tabs_h ajax">
                            <li class="income"><a href="/bill/" title="记账"><i></i>记账</a><span>
                                    <a href="/bill/add/" title="新增记账" id="bill_add" class="dialog" callback="bill_callback">新增</a></span></li>
                            <li class="budget"><a href="/budget/" title="预算"><i></i>预算</a></li>
                            <li class="statics"><a href="/statics/" title="统计"><i></i>统计</a></li>
                            <li class="diary"><a href="/diary/" title="日记"><i></i>日记</a></li>
                            <li class="bbs"><a href="/bbs/" title="论坛"><i></i>论坛</a><em><a href="/bbs/"><?= $threadnew ?></a></em></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div id="primary">
                <?php include VIEWPATH . "{$module}.php"; ?>
            </div>
        </div>
        <?php include VIEWPATH . "foot.php"; ?>
    </body>
</html>